import {post} from '@/utils/http'

export function getVirtualNumberInfo(data = {}){
  // 添加默认参数
  const defaultData = {
    ...data
  }
  return post('/user/user-client/cms/virtualNumber/listAll', defaultData)
}

//新增
export function createVirtualNumberInfo(data) {
  return post('/user/user-client/cms/virtualNumber/insert', data)
}

//修改
export function updateVirtualNumberInfo(data) {
  return post('/user/user-client/cms/virtualNumber/update', data)
}

//删除
export function deleteVirtualNumberInfo(id) {
  return post('/user/user-client/cms/virtualNumber/delete', null, { 
    params: { id }
  })
}

//批量删除
export function deleteBatchVirtualNumberInfo(virtualNumbers) {
  // virtualNumbers 应该是一个数组，包含要删除的虚拟号码
  // 将数组转换为逗号分隔的字符串
  const ids = virtualNumbers.join(',');
  return post('/user/user-client/cms/virtualNumber/deleteBatch', null, {
    params: { ids }
  });
}

//查询单个
export function getVirtualNumberInfoById(id) {
  return post('/user/user-client/cms/virtualNumber/get', {id})
}
